| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | git-rev-list(1) | 
|  | 2 | =============== | 
|  | 3 |  | 
|  | 4 | NAME | 
|  | 5 | ---- | 
|  | 6 | git-rev-list - Lists commit objects in reverse chronological order | 
|  | 7 |  | 
|  | 8 |  | 
|  | 9 | SYNOPSIS | 
|  | 10 | -------- | 
| Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 11 | [verse] | 
| Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 12 | 'git rev-list' [ \--max-count=<number> ] | 
|  | 13 | [ \--skip=<number> ] | 
|  | 14 | [ \--max-age=<timestamp> ] | 
|  | 15 | [ \--min-age=<timestamp> ] | 
| Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 16 | [ \--sparse ] | 
| Junio C Hamano | 934e178 | 2009-07-16 06:59:15 | [diff] [blame] | 17 | [ \--merges ] | 
| Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 18 | [ \--no-merges ] | 
| Junio C Hamano | f32ce26 | 2011-03-27 07:35:11 | [diff] [blame] | 19 | [ \--min-parents=<number> ] | 
|  | 20 | [ \--no-min-parents ] | 
|  | 21 | [ \--max-parents=<number> ] | 
|  | 22 | [ \--no-max-parents ] | 
| Junio C Hamano | 554da79 | 2007-12-27 03:29:58 | [diff] [blame] | 23 | [ \--first-parent ] | 
| Junio C Hamano | 9be1897 | 2006-01-28 08:54:57 | [diff] [blame] | 24 | [ \--remove-empty ] | 
| Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 25 | [ \--full-history ] | 
| Junio C Hamano | 872c568 | 2006-07-07 06:05:40 | [diff] [blame] | 26 | [ \--not ] | 
| Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 27 | [ \--all ] | 
| Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 28 | [ \--branches[=<pattern>] ] | 
|  | 29 | [ \--tags[=<pattern>] ] | 
|  | 30 | [ \--remotes[=<pattern>] ] | 
|  | 31 | [ \--glob=<glob-pattern> ] | 
| Junio C Hamano | c9245d9 | 2006-09-06 09:35:46 | [diff] [blame] | 32 | [ \--stdin ] | 
| Junio C Hamano | 8c5802d | 2007-11-15 00:13:36 | [diff] [blame] | 33 | [ \--quiet ] | 
| Junio C Hamano | decf50e | 2006-03-05 10:51:14 | [diff] [blame] | 34 | [ \--topo-order ] | 
| Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 35 | [ \--parents ] | 
| Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 36 | [ \--timestamp ] | 
| Junio C Hamano | 5678d69 | 2007-04-06 00:51:43 | [diff] [blame] | 37 | [ \--left-right ] | 
| Junio C Hamano | 9a2fb2d | 2011-03-23 05:40:15 | [diff] [blame] | 38 | [ \--left-only ] | 
|  | 39 | [ \--right-only ] | 
|  | 40 | [ \--cherry-mark ] | 
| Junio C Hamano | d9e0e5d | 2007-04-14 16:22:04 | [diff] [blame] | 41 | [ \--cherry-pick ] | 
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 42 | [ \--encoding[=<encoding>] ] | 
| Junio C Hamano | 47c1e3c | 2006-09-25 04:45:55 | [diff] [blame] | 43 | [ \--(author|committer|grep)=<pattern> ] | 
| Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 44 | [ \--regexp-ignore-case | -i ] | 
|  | 45 | [ \--extended-regexp | -E ] | 
|  | 46 | [ \--fixed-strings | -F ] | 
| Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 47 | [ \--date=(local|relative|default|iso|rfc|short) ] | 
| Junio C Hamano | 5f32776 | 2006-03-02 09:14:51 | [diff] [blame] | 48 | [ [\--objects | \--objects-edge] [ \--unpacked ] ] | 
| Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 49 | [ \--pretty | \--header ] | 
|  | 50 | [ \--bisect ] | 
| Junio C Hamano | 20f64da | 2007-04-04 18:38:30 | [diff] [blame] | 51 | [ \--bisect-vars ] | 
| Junio C Hamano | 1974bf2 | 2007-10-31 05:57:20 | [diff] [blame] | 52 | [ \--bisect-all ] | 
| Junio C Hamano | 859f3b4 | 2006-08-04 10:04:30 | [diff] [blame] | 53 | [ \--merge ] | 
| Junio C Hamano | 053827f | 2007-02-14 07:23:58 | [diff] [blame] | 54 | [ \--reverse ] | 
| Junio C Hamano | db450ba | 2007-01-21 08:57:14 | [diff] [blame] | 55 | [ \--walk-reflogs ] | 
| Junio C Hamano | a196f6d | 2007-07-24 08:10:27 | [diff] [blame] | 56 | [ \--no-walk ] [ \--do-walk ] | 
| Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 57 | <commit>... [ \-- <paths>... ] | 
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 58 |  | 
|  | 59 | DESCRIPTION | 
|  | 60 | ----------- | 
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 61 |  | 
| Junio C Hamano | 31cca16 | 2009-08-07 05:40:01 | [diff] [blame] | 62 | List commits that are reachable by following the `parent` links from the | 
|  | 63 | given commit(s), but exclude commits that are reachable from the one(s) | 
|  | 64 | given with a '{caret}' in front of them. The output is given in reverse | 
|  | 65 | chronological order by default. | 
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 66 |  | 
| Junio C Hamano | 31cca16 | 2009-08-07 05:40:01 | [diff] [blame] | 67 | You can think of this as a set operation. Commits given on the command | 
|  | 68 | line form a set of commits that are reachable from any of them, and then | 
|  | 69 | commits reachable from any of the ones given with '{caret}' in front are | 
|  | 70 | subtracted from that set. The remaining commits are what comes out in the | 
|  | 71 | command's output. Various other options and paths parameters can be used | 
|  | 72 | to further limit the result. | 
|  | 73 |  | 
|  | 74 | Thus, the following command: | 
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 75 |  | 
|  | 76 | ----------------------------------------------------------------------- | 
| Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 77 | $ git rev-list foo bar ^baz | 
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 78 | ----------------------------------------------------------------------- | 
|  | 79 |  | 
| Junio C Hamano | 31cca16 | 2009-08-07 05:40:01 | [diff] [blame] | 80 | means "list all the commits which are reachable from 'foo' or 'bar', but | 
|  | 81 | not from 'baz'". | 
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 82 |  | 
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 83 | A special notation "'<commit1>'..'<commit2>'" can be used as a | 
|  | 84 | short-hand for "{caret}'<commit1>' '<commit2>'". For example, either of | 
|  | 85 | the following may be used interchangeably: | 
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 86 |  | 
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 87 | ----------------------------------------------------------------------- | 
| Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 88 | $ git rev-list origin..HEAD | 
|  | 89 | $ git rev-list HEAD ^origin | 
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 90 | ----------------------------------------------------------------------- | 
|  | 91 |  | 
|  | 92 | Another special notation is "'<commit1>'...'<commit2>'" which is useful | 
|  | 93 | for merges. The resulting set of commits is the symmetric difference | 
| Junio C Hamano | 872c568 | 2006-07-07 06:05:40 | [diff] [blame] | 94 | between the two operands. The following two commands are equivalent: | 
|  | 95 |  | 
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 96 | ----------------------------------------------------------------------- | 
| Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 97 | $ git rev-list A B --not $(git merge-base --all A B) | 
|  | 98 | $ git rev-list A...B | 
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 99 | ----------------------------------------------------------------------- | 
|  | 100 |  | 
| Junio C Hamano | 27a128b | 2009-08-13 01:23:00 | [diff] [blame] | 101 | 'rev-list' is a very essential git command, since it | 
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 102 | provides the ability to build and traverse commit ancestry graphs. For | 
|  | 103 | this reason, it has a lot of different options that enables it to be | 
| Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 104 | used by commands as different as 'git bisect' and | 
|  | 105 | 'git repack'. | 
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 106 |  | 
|  | 107 | OPTIONS | 
|  | 108 | ------- | 
| Junio C Hamano | 89e135d | 2006-09-03 06:18:25 | [diff] [blame] | 109 |  | 
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 110 | :git-rev-list: 1 | 
|  | 111 | include::rev-list-options.txt[] | 
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 112 |  | 
|  | 113 | include::pretty-formats.txt[] | 
|  | 114 |  | 
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 115 | GIT | 
|  | 116 | --- | 
| Junio C Hamano | f7c042d | 2008-06-06 22:50:53 | [diff] [blame] | 117 | Part of the linkgit:git[1] suite |